//
//  KABCosTopicTCell.m
//  kabu
//
//  Created by XiangDongMBP on 2017/4/20.
//  Copyright © 2017年 East. All rights reserved.
//

#import "KABCosTopicTCell.h"
#import "KABModel.h"
#import <YYWebImage.h>

@implementation KABCosTopicTCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configViewWithTopicItem:(KABCosplayTopicItem *)item {
    [self.topicImgView yy_setImageWithURL:[NSURL URLWithString:item.cosplaytopic_cover_img_url]
                                 placeholder:[KABDefaultVarModel sharedInstance].smallDefaultImg];
    self.topicTitleLabel.text = [NSString stringWithFormat:@"#%@#", item.cosplaytopic_content];
}

@end


@implementation KABCosTopicTCell (ExhibitionSearch)
- (void)configViewWithExhSeaItem:(KABExhSearchItem *)item {
    [self.topicImgView yy_setImageWithURL:[NSURL URLWithString:item.exhibition_cover_image_url]
                              placeholder:[KABDefaultVarModel sharedInstance].smallDefaultImg];
    self.topicTitleLabel.text = item.exhibition_name;
}
@end


@implementation KABCosTopicTCell (AtUserSearch)
- (void)configViewWithUserItem:(KABMineUserItem *)item {
    self.topicImgView.layer.masksToBounds = YES;
    self.topicImgView.layer.cornerRadius = CGRectGetWidth(self.topicImgView.bounds) / 2.0;
    [self.topicImgView yy_setImageWithURL:[NSURL URLWithString:item.headimg_url]
                              placeholder:[KABDefaultVarModel sharedInstance].smallDefaultImg];
    
    self.topicTitleLabel.text = item.nick_name;
}
@end
